<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>新订订单 - 物流管理系统</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<style media="all" type="text/css">
		@import "../../style/all.css";
		@import "../../style/jquery/ui.all.css";
	</style>
	<script type="text/javascript" src="../../script/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="../../script/jquery-ui-personalized-1.6rc6.min.js"></script>
	<script type="text/javascript" src="../../script/date.js"></script>
	<script type="text/javascript" src='../../script/common.js'></script>
	<script type="text/javascript">
		$(function(){
			datepicker('.date-six');
			
		});
		
		$(function(){
			$("#add").click(function(){	
				alert("aaa");
				  var orderdate = $("#orderDate").val();				
				  var requireddate = $("#requireddate").val();
				  var ordertype = $("#orderType").val();
				  var receiveadd = $("#receiveadd").val();
				  var receiveperson = $("#receiveperson").val();			
				  var receivepersonzip = $("#receivepersonzip").val();			
				  var payer = $("#payer").val();
				  var payeradd = $("#payeradd").val();
				  var payertel = $("#payertel").val();
				  var payerzipcode = $("#payerzip").val();
				  var deliversubstation = $("#station").val();
					$.ajax({
					   type:"post", 
					   url:"../../customer/addOrder",
					   contentType:"application/json",					
					   data:JSON.stringify({"orderdate": orderdate,"requireddate": requireddate,"ordertype":ordertype,"receiveadd": receiveadd,"receiveperson":receiveperson,"receivepersonzip":receivepersonzip,"payer":payer,"payeradd":payeradd,"payertel":payertel,"payerzipcode":payerzipcode,"deliversubstation":deliversubstation}),
					   success:function(result){
						   alert(result);
						   window.location.href='../../customer/getAllcusOther';
						   }
					 
				   });
			});
		}) ;
		function createTime(){
			var t1 = new Date();
			document.getElementById("orderformGenerateDate").value=t1.toLocaleString();
		}
		

	</script>
</head>
<body style="background: none" onload="createTime()">
	<div class="top-bar">
		<!--a href="#" class="button">取 消</a><a href="#" class="button">保 存</a-->
		<h1>新订订单</h1>
		<div class="breadcrumbs">
			<a href="../../index.html" target="_top">首页</a> /
			<a href="../index.html" target="_top">客户服务中心</a>
		</div>
	</div>
	<div class="select-bar"/>
	<div class="table">
		<img src="../../style/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
		<img src="../../style/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<form name="frm3" method="post">
		<table class="listing form" cellpadding="0" cellspacing="0">
				<tr>
				<th class="full" colspan="4">新订订单(*号为必填项)</th>
			</tr>
			<tr>
				<td class="first" style="white-space:nowrap">订单生成日期(*)</td>				
				<td><input name="orderformGenerateDate" type='text' class="date-six text" id="orderDate" readonly="readonly"/></td>
				<td>要求完成日期(*)</td>
				<td class="last" style="white-space:nowrap"><input name="expectDeliverDate" type='text' class="date-six text" id="requireddate" readonly="readonly"/></td>
			</tr>
			<tr>
				<td class="first">订单类型</td>
				<td>
					<select style="width:134px" id="orderType">
						<option>新订</option>
						<option>异地收费</option>
					</select>
				</td>
				<td>送货地址(*)</td>
				<td class="last"><input name="deliverAddress" type="text" class="text" id="receiveadd" value="客户联系地址(可修改)"/></td>
			</tr>
			<tr>
				<td class="first">收货人(*)</td>
				<td><input type="text" name="receivedBy" id="receiveperson" class="text" value="客户姓名(可修改)"/></td>
                <td class="first">收货人邮编</td>
				<td><input type="text"  class="text" id="receivepersonzip" value="客户邮编(可修改)"/></td>
			</tr>
			<tr>
				<td class="first" >付款人</td>
				<td colspan="3" class="last">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="text"  class="text" id="payer" />(只有订单类型为异地收费时需要填写该信息)
				</td>
			</tr>
			<tr>
				<td class="first" >付款人地址</td>
				<td colspan="3" class="last">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="text"  class="text" id="payeradd" />(同上)
				</td>
			</tr>
			<tr>
				<td class="first" >付款人电话</td>
				<td colspan="3" class="last">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="text"  class="text" id="payertel" />(同上)
				</td>
			</tr>
			<tr>
				<td class="first" >付款人邮编</td>
				<td colspan="3" class="last">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="text"  class="text" id="payerzip" />(同上)
				</td>
			</tr>
			<tr>
				<td class="first">货物投递分站</td>
				<td class="last" colspan="3">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="text" class="text" id="station" />
				</td>				
			</tr>
		</table>
		<br/>
		<div align="center" style="width:100%;">
			<input type="button" class="button" onclick="javascript:window.history.go(-1)" value="上一步"/>&nbsp;
			<input type="button" class="button" id="add" value="生成订单"/>
		</div>
</form>
	</div>
</body>
</html>
